﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="expires" content="-1" />
	<link rel="stylesheet" type="text/css" href="/site_media/css/style.css" />
	<script type="text/javascript" src="/site_media/js/script.js"></script>
	<title>Labmin - lista studentów</title>
</head>
<body>
	<div id="wrap">
		{% include "header.html" %}
		{% if request.session.user %}
			<div id="content-wrap">
				{% include "sidebar.html" %}
				<div id="main">
					<div class="box">
                		<h1>Lista <span class="gray">studentów</span></h1>
					</div>
                
				<form name="form" action="" method="post" style="margin: 0px">
				<input type="hidden" id="student_pk_input" name="student_pk" value="" />
                <div class="box" style="padding: 10px;">
                    <input type="text" name="filter_login">
                    <input class="button" type="button" name="filter" value="Filtruj" onclick="document.form.action='/students_list'; document.form.submit();">
                </div>
				<div class="box" style="padding: 10px;">
					<table class="list_table">
					{% for student in objects %}
						<tr>
							<td><input type="checkbox" name="list" value="{{ student.pk }}"/></td>
							<td><a href="show_student/{{student.pk}}"><b>{{ student.login }}</b></a></td>
							<td>{{ student.email }}</td>
							<td><a href="student_form/{{ student.pk }}">Edytuj</a></td>
							<td><a href="#" onclick="document.form.action='/delete_students'; setHiddenValueAndSubmit('student_pk_input', '{{student.pk}}')">Usuń</a></td>
						</tr>
					{% endfor %}
					</table>
					<div class="button_group">
						<input class="button" type="button" onclick="checkAll()" value="Zaznacz wszystko">
						<input class="button" type="button" onclick="uncheckAll()" value="Wyczyść zaznaczenie">
						<input class="button" type="button" onclick="invertAll()" value="Odwróć zaznaczenie">
					</div>
				</div>
				<div class="box" style="padding: 10px;">
					Operacje na zaznaczonych pozycjach:
					<div class="button_group">
					<input class="button" type="button" value="Usuń" onclick="document.form.action='/delete_students'; document.form.submit();" />
					<input class="button" type="button" value="Twórz grupę" onclick="document.form.action='/student_group_form'; document.form.submit();" />
				</div>
				</div>
				</form>
				</div>
			</div>
		{%endif%}
	</div>
	{% include "footer.html" %}
</body>
</html>
